<template>
  <div class="article-page">
    <div
      class="article-item"
      v-for="item in info"
      :key="item.houseCode"
      @click="clicktext(item.houseCode)"
    >
      <div class="head">
        <img :src="item.houseImg" alt="" />
        <div class="con">
          <p class="title"></p>
          <p class="other">|</p>
        </div>
      </div>
      <div class="body">
        {{ item.desc }}
      </div>
      <div class="foot">价格 {{ item.price }} | 浏览 {{ item.tags[0] }}</div>
    </div>
  </div>
</template>

<script>
// import axios from 'axios'

export default {
  name: 'House',

  props: {},
  components: {},
  data() {
    return {
      info: null,
    }
  },
  methods: {
    clicktext(houseCode) {
      this.$router.push({
        name: 'house',
        query: {houseCode,}
        
      })
    },
  },

  // async created() {
  //   const { data } = await axios.get(
  //     'http://liufusong.top:8080/houses6-1196&stat=1&end=10'
  //   )
  //   console.log(data)
  //   this.info = data.body.list
  // },
}
</script>

<style scoped lang="less">
.article-page {
  background: #f5f5f5;
}
.article-item {
  margin-bottom: 10px;
  background: #fff;
  padding: 10px 15px;
  .head {
    display: flex;
    img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      overflow: hidden;
    }
    .con {
      flex: 1;
      overflow: hidden;
      padding-left: 15px;
      p {
        margin: 0;
        line-height: 1.5;
        &.title {
          text-overflow: ellipsis;
          overflow: hidden;
          width: 100%;
          white-space: nowrap;
        }
        &.other {
          font-size: 10px;
          color: #999;
        }
      }
    }
  }
  .body {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .foot {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
  }
}
</style>
